package com.rongshe.hotel.service.impl;

import java.util.List;
import com.rongshe.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.rongshe.hotel.mapper.RsSliderMapper;
import com.rongshe.hotel.domain.RsSlider;
import com.rongshe.hotel.service.IRsSliderService;

/**
 * 轮播图Service业务层处理
 * 
 * @author rongshe
 * @date 2025-02-17
 */
@Service
public class RsSliderServiceImpl implements IRsSliderService 
{
    @Autowired
    private RsSliderMapper rsSliderMapper;

    /**
     * 查询轮播图
     * 
     * @param id 轮播图主键
     * @return 轮播图
     */
    @Override
    public RsSlider selectRsSliderById(Long id)
    {
        return rsSliderMapper.selectRsSliderById(id);
    }

    /**
     * 查询轮播图列表
     * 
     * @param rsSlider 轮播图
     * @return 轮播图
     */
    @Override
    public List<RsSlider> selectRsSliderList(RsSlider rsSlider)
    {
        return rsSliderMapper.selectRsSliderList(rsSlider);
    }

    /**
     * 新增轮播图
     * 
     * @param rsSlider 轮播图
     * @return 结果
     */
    @Override
    public int insertRsSlider(RsSlider rsSlider)
    {
        rsSlider.setCreateTime(DateUtils.getNowDate());
        return rsSliderMapper.insertRsSlider(rsSlider);
    }

    /**
     * 修改轮播图
     * 
     * @param rsSlider 轮播图
     * @return 结果
     */
    @Override
    public int updateRsSlider(RsSlider rsSlider)
    {
        rsSlider.setUpdateTime(DateUtils.getNowDate());
        return rsSliderMapper.updateRsSlider(rsSlider);
    }

    /**
     * 批量删除轮播图
     * 
     * @param ids 需要删除的轮播图主键
     * @return 结果
     */
    @Override
    public int deleteRsSliderByIds(Long[] ids)
    {
        return rsSliderMapper.deleteRsSliderByIds(ids);
    }

    /**
     * 删除轮播图信息
     * 
     * @param id 轮播图主键
     * @return 结果
     */
    @Override
    public int deleteRsSliderById(Long id)
    {
        return rsSliderMapper.deleteRsSliderById(id);
    }
}
